<?php

class bannersActions extends myFrontendAction{

	public function executeIframe(sfWebRequest $request)
	{
		$this->setLayout(false);

		$this->banners = $this->getBanners();
		$this->bg = $this->getBannerGroup();
		$this->firstBanner = $this->banners[0];
	}


	public function getBannerGroup(){
		return Doctrine::getTable('BannerGroup')->find($this->getRequestParameter('bgID',''));
	}

	public function getBanners(){
		$bg = $this->getBannerGroup();
		if(!$bg)return array();


		return $bg->getBanners();
	}

}